package org.red_cross_service.controller;

import org.red_cross_service.common.anno.NoNeedToken;
import org.red_cross_service.common.response.Response;
import org.red_cross_service.domain.Protocol;
import org.red_cross_service.service.ProtocolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/api/protocol")
@CrossOrigin
public class ProtocolController {

    @Autowired
    private ProtocolService protocolService;

    //用户协议接口
    @NoNeedToken
    @GetMapping("/get")
    public Response getProtocol(){
        return Response.success("成功",protocolService.getProtocol());
    }

    //更改用户协议
    @NoNeedToken
    @PostMapping("/update")
    public Response updateProtocol(@RequestBody Protocol protocol){
        return Response.success("成功",protocolService.updateProtocol(protocol));
    }


}
